<?php /*a:1:{s:60:"D:\web\www\tp5.1\public/../app/admin\view\partition\add.html";i:1526302088;}*/ ?>
<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8"/>
        <title>添加区服</title>
        <meta name="renderer" content="webkit"/>
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
        <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/>
        <link rel="stylesheet" href="/static/frame/layui/css/layui.css"/>
        <link rel="stylesheet" href="/static/frame/static/css/style.css"/>
        <link rel="icon" href="/static/frame/static/image/code.png"/>
        <!-- 注意：如果你直接复制所有代码到本地，上述css路径需要改成你本地的 -->
        <style type="text/css">
.dbshow{background: #fff;overflow:hidden;border:0;}
.dbshow .layui-colla-item{overflow:hidden;}
.dbshow .layui-colla-title{background:#fff;text-align: center;}
.dbshow .layui-colla-title .layui-colla-icon{left:auto;}
.dbshow .layui-colla-content{border:0;}
    </style>
    </head>
    <body class="body">
        <form class="layui-form" action="" method="post" id="addform">
            <div class="layui-form-item">
                <label class="layui-form-label">
                    分区名称
                </label>
                <div class="layui-input-inline">
                    <input type="text" name="name" lay-verify="title" autocomplete="off" placeholder="分区名称" class="layui-input"/>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">
                    平台
                </label>
                <div class="layui-input-inline">
                    <select name="platform_id" lay-verify="required" lay-search="">
                        <?php foreach($platform as $key=>$vo): ?>
                        <option value="<?php echo htmlentities($vo['id']); ?>"><?php echo $vo['name']; ?></option>
                        <?php endforeach; ?>
                    </select>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">
                    区服编号
                </label>
                <div class="layui-input-inline">
                    <input type="text" name="num" placeholder="区服编号" class="layui-input"/>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">
                    区服地址
                </label>
                <div class="layui-input-block">
                    <input type="text" name="http" placeholder="区服地址" class="layui-input"/>
                </div>
            </div>

<div class="layui-row" id="dbshow">


<div class="layui-collapse dbshow" lay-accordion="">
  <div class="layui-colla-item">
    <h2 class="layui-colla-title">数据配制</h2>
    <div class="layui-colla-content">
<div class="layui-row"
    <p>数据库信息默认为平台配制信息，如果没有请留空</p>
</div>


<div class="layui-col-xs6 layui-col-sm6 layui-col-md4">   

            <div class="layui-form-item">
                <label class="layui-form-label">
                    游戏数据库主机
                </label>
                <div class="layui-input-inline">
                    <input type="text" name="gamehost" placeholder="游戏数据库主机" class="layui-input"/>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">
                    游戏数据库端口
                </label>
                <div class="layui-input-inline">
                    <input type="number" name="gameport" placeholder="游戏数据库端口" class="layui-input"/>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">
                    游戏数据库用户
                </label>
                <div class="layui-input-inline">
                    <input type="text" name="gameuser" placeholder="游戏数据库用户" class="layui-input"/>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">
                    游戏数据库密码
                </label>
                <div class="layui-input-inline">
                    <input type="text" name="gamepass" placeholder="游戏数据库密码" class="layui-input"/>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">
                    游戏数据库名称
                </label>
                <div class="layui-input-inline">
                    <input type="text" name="gamename" placeholder="游戏数据库名称" class="layui-input"/>
                </div>
            </div>
</div>
<div class="layui-col-xs6 layui-col-sm6 layui-col-md4">   

            <div class="layui-form-item">
                <label class="layui-form-label">
                    用户数据库主机
                </label>
                <div class="layui-input-inline">
                    <input type="text" name="userhost" placeholder="用户数据库主机" class="layui-input"/>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">
                    用户数据库端口
                </label>
                <div class="layui-input-inline">
                    <input type="number" name="userport" placeholder="用户数据库端口" class="layui-input"/>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">
                    用户数据库用户
                </label>
                <div class="layui-input-inline">
                    <input type="text" name="useruser" placeholder="用户数据库用户" class="layui-input"/>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">
                    用户数据库密码
                </label>
                <div class="layui-input-inline">
                    <input type="text" name="userpass" placeholder="用户数据库密码" class="layui-input"/>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">
                    用户数据库名称
                </label>
                <div class="layui-input-inline">
                    <input type="text" name="username" placeholder="用户数据库名称" class="layui-input"/>
                </div>
            </div>
</div>

<div class="layui-col-xs6 layui-col-sm6 layui-col-md4">   
            <div class="layui-form-item">
                <label class="layui-form-label">
                    日志数据库主机
                </label>
                <div class="layui-input-inline">
                    <input type="text" name="loghost" placeholder="数据库主机" class="layui-input"/>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">
                    数据库端口
                </label>
                <div class="layui-input-inline">
                    <input type="number" name="logport" placeholder="数据库端口" class="layui-input"/>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">
                    数据库用户
                </label>
                <div class="layui-input-inline">
                    <input type="text" name="loguser" placeholder="数据库用户" class="layui-input"/>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">
                    数据库密码
                </label>
                <div class="layui-input-inline">
                    <input type="text" name="logpass" placeholder="数据库密码" class="layui-input"/>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">
                    数据库名称
                </label>
                <div class="layui-input-inline">
                    <input type="text" name="logname" placeholder="数据库名称" class="layui-input"/>
                </div>
            </div>
        </div>
        </div>
    </div>
  </div>
</div>

        </div>
        <div class="layui-form-item">
            <div class="layui-inline">
                <label class="layui-form-label">
                    状态
                </label>
                <div class="layui-input-inline">
                    <input type="radio" name="status" value="1" title="正常" checked=""/>
                    <input type="radio" name="status" value="0" title="禁止"/>
                </div>
            </div>
        </div>
        <div class="layui-form-item">
            <div class="layui-input-block">
                <button class="layui-btn" lay-submit="" lay-filter="demo1">
                    立即提交
                </button>
                <button type="reset" class="layui-btn layui-btn-primary">
                    重置
                </button>
            </div>
        </div>
    </form>
    <script src="/static/frame/layui/layui.js" charset="utf-8"></script>
    <script src="/static/admin/js/comm.js" charset="utf-8"></script>
    <script>
        layui.use(['jquery', 'form', 'upload', 'laydate', 'layedit', 'laydate','admin'], function() {
          var form = layui.form,
            layer = layui.layer,
            upload = layui.upload,
            $ = layui.$, //重点处
            layedit = layui.layedit,
            laydate = layui.laydate,
            admin = layui.admin;
    
          //自定义验证规则
          form.verify({
            title: function(value) {
              if (value.length < 2) {
                return '标题至少得2个字符啊';
              }
            }
          });
    
          laydate.render({
            elem: '#date1'
          });
    
        //监听指定开关
        form.on('submit(demo1)', function(data){
            admin.action("<?php echo url('admin/Partition/add'); ?>",$("#addform").serialize());
            return false;
        });
    
        });
    </script>
</body>
</html>
